<template>
    <div class="startview">
        <a-modal v-model:visible="visible" title="模块选择" @ok="handleOk" :ok-button-props="{ disabled: true }"
            :cancel-button-props="{ disabled: true }">
            <router-link to="/mine">
                <p>个人中心</p>
            </router-link>
            <router-link to="/data">
            <p>数据中心</p>
            </router-link>
            <router-link to="/Achievements">
            <p>成就中心</p>
            </router-link>
            <p @click="logout">退出登录</p>
        </a-modal>
        <button class="setbtn" @click="openset"></button>
        <button class="startbtn" @click="start"></button>
    </div>
</template>
<script setup>
import { ref,onMounted } from 'vue'
import { useRouter } from 'vue-router';
import api from '@/api/user';
const visible = ref(false)
const router = useRouter();
const start = () => {
    router.push({ name: 'bigcontroller' });
}
const openset = () => {
    visible.value = true;
}
const logout=()=>{
localStorage.removeItem("token");
    router.push("/");
}
onMounted(()=>{
api.getinfo().then((res)=>{
    console.log(res);
    if(res.data.name==null){
        router.push("/mine")
    }
})
})
</script>
<style lang="scss" scoped>
.startview {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: url('@/static/back.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;

    .setbtn {
        position: absolute;
        right: 3rem;
        top: 3rem;
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        background-image: url("@/static/set.jpg");
        background-color: transparent;
        /* 将背景颜色设置为透明 */
        height: 5rem;
        width: 5rem;
    }

    .startbtn {
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        background-image: url("@/static/startbtn.jpg");
        background-color: transparent;
        /* 将背景颜色设置为透明 */
        height: 20rem;
        width: 20rem;
    }
}
</style>